package com.lcredu.springboot.mybatis.service.impl;

import com.lcredu.springboot.mybatis.entity.Monster;
import com.lcredu.springboot.mybatis.mapper.MonsterMapper;
import com.lcredu.springboot.mybatis.service.MonsterService;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;

import javax.annotation.Resource;

/**
 * @author 黎长容
 * @date 2025-08-18 16:33
 */
@Service
public class MonsterServiceImpl implements MonsterService {
    @Resource
    private MonsterMapper monsterMapper;

    @Override
    public Monster getMonsterById(Integer id) {
        Monster monster = monsterMapper.getMonsterById(id);
        if (ObjectUtils.isEmpty(monster)) {
            return null;
        }
        return monster;
    }
}
